package com.my.ribbon.support;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import java.util.ArrayList;
import java.util.List;

/**
 * @author timo 2021/3/23
 */
@RefreshScope
@ConfigurationProperties("custom.ribbon.rule")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CustomRibbonRuleProperties {
    public static final String PROPERTIES_PREFIX = "custom.ribbon.rule";
    private boolean enabled = false;
    private String tag;
    private List<String> priorIpPattern = new ArrayList();
}

/*
网关中配置
custom:
  #多团队协作服务配置
  ribbon:
    rule:
      #开启配置
      enabled: true
      #负载均衡优先调用的ip段
      prior-ip-pattern:
#        - 127.0.0.1
#        加入白名单的ip地址
#       泸州内网
#        - 172.1.4.198
#        成都内网 注册到nacos中的地址
        - 2.0.1.*
*/
